<template>
  <h1>Counter</h1>
  <button @click="decrement">-</button>
  {{ counter }}
  <button @click="increment">+</button>
</template>

<script setup>
import { ref } from 'vue';
import { useCounterStore } from '@/stores/counter';
import { storeToRefs } from 'pinia';

const store = useCounterStore();

const { decrement, increment } = store;
const { counter } = storeToRefs(store);
</script>
